package com.wing.order.model.response;

import com.wing.cabinet.model.entity.StorageInventoryInout;
import com.wing.cabinet.utils.ExcelExport;
import lombok.Data;
import lombok.NoArgsConstructor;
import lombok.experimental.Accessors;
import java.time.LocalDateTime;
import com.fasterxml.jackson.annotation.JsonFormat;
import java.time.LocalDateTime;
import com.baomidou.mybatisplus.annotation.TableField;
import com.wing.order.model.entity.OldNewOrder;

/**
 * 以旧换新(存旧刀，领新刀)VO
 *
 * @author
 */
@Data
@NoArgsConstructor
@Accessors(chain = true)
public class OldNewOrderVO {

    /**
     * ID
     */
    private Long id;

    /**
     * 创建时间
     */
    @ExcelExport(value = "创建时间",sort = 13)
    @JsonFormat(timezone = "GMT+8" , pattern = "yyyy-MM-dd HH:mm:ss" )
    private LocalDateTime createTime;

    /**
     * 创建者
     */
    private Long creator;

    /**
     * 修改者
     */
    private Long modifier;

    /**
     * 创建人
     */
    @ExcelExport(value = "创建人",sort = 12)
    private String creatorName;

    /**
     * 修改人
     */
    private String modifierName;

    /**
     * 存刀任务编号
     */
    @ExcelExport(value = "订单编号",sort = 6)
    private String code;

    /**
     * 订单id
     */
    private Long deliveryId;

    /**
     * 状态
     */
    private OldNewOrder.Status status;

    /**
    * 状态描述
    */
    @TableField(exist = false)
    private String statusDesc;

    public String getStatusDesc() {
        return status.getDesc();
    }

    /**
     * no
     */
    private Integer no;

    /**
     * day
     */
    private Integer day;

    /**
     * 设备台机
     */
    @ExcelExport(value = "机台",sort = 5)
    private String deviceCode;

    /**
     * 是否已同步：no(0,未同步);yes(1,已同步);
     */
    private Integer isSyns;

    /**
     * 同步时间
     */
    @JsonFormat(timezone = "GMT+8" , pattern = "yyyy-MM-dd HH:mm:ss" )
    private LocalDateTime synsTime;

    /**
     * 是否已形成账单
     */
    private OldNewOrder.IsBill isBill;

    /**
    * 是否已形成账单描述
    */
    @TableField(exist = false)
    private String isBillDesc;

    public String getIsBillDesc() {
        return isBill.getDesc();
    }

    /**
     * companyId
     */
    private Long companyId;

    /**
     * 之前领新单id(关联cab_cell_inventory_inout表的id)
     */
    private Long oldCellInventoryInoutId;

    /**
     * 暂存柜存入id(关联cab_storage_inventory_inout表的id)
     */
    private Long storageInventoryInoutId;

    /**
     * 新领新单id(关联cab_cell_inventory_inout表的id)
     */
    private Long newCellInventoryInoutId;
    /**
     * skuCode
     */
    @ExcelExport(value = "物料编号",sort = 2)
    private String skuCode;

    /**
     * 旧的领新编号
     */
    @TableField(exist = false)
    private String oldLeadNewCode;
    /**
     * 旧的领新所属刀柜
     */
    @TableField(exist = false)
    private String oldLeadNewCab;
    /**
     * 存刀订单编号
     */
    @ExcelExport(value = "旧刀存入订单",sort = 8)
    @TableField(exist = false)
    private String storageCode;
    /**
     * 存刀订单库位
     */
    @ExcelExport(value = "旧刀存入货位",sort = 7)
    @TableField(exist = false)
    private String storageSeat;
    /**
     * 存刀订单状态
     */
    @TableField(exist = false)
    private String storageStatus;

    /**
     * 新的领新编号
     */
    @ExcelExport(value = "领新订单编号",sort = 11)
    @TableField(exist = false)
    private String newLeadNewCode;
    /**
     * 新的领新状态
     */
    @TableField(exist = false)
    private String newLeadNewStatus;
    /**
     * 新的领新出货货道
     */
    @ExcelExport(value = "领新出货货道",sort = 10)
    @TableField(exist = false)
    private String newLeadNewSpaceCode;

    private Long workOrderId;

    private String enterpriseCode;



    private String roleName;

    /**
     * 存入状态
     */
    @ExcelExport(value = "存入方式",sort = 9,kv = "losed-缺失;temp-暂存;repair-报修;recycle-报废;outByReturned-归还仓库管理员;exhibit-格子柜上货;loss-报失;unload-格子柜下货")
    private StorageInventoryInout.BusinessType storageBusinessType;

    /**
     * 操作类型描述
     */
    @TableField(exist = false)
    private String storageBusinessTypeDesc;

    public String getStorageBusinessTypeDesc() {
        return storageBusinessType == null ? null : storageBusinessType.getDesc();
    }

    @ExcelExport(value = "规格码",sort = 3)
    @TableField(exist = false)
    private String skuSpecOld ;

    @ExcelExport(value = "物料名称",sort = 1)
    @TableField(exist = false)
    private String skuName;
    @ExcelExport(value = "品牌",sort = 4)
    private String productBrandName;
    private Long departmentId;
    @ExcelExport(value = "成本中心",sort = 6)
    private String costCenter;
    @ExcelExport(value = "部门",sort = 6)
    private String departmentName;
}
